package com.cnap.multiclouldmgmt.model.scale.policy;

import com.cnap.multiclouldmgmt.model.scale.validator.ValidInterface;

/**
 * <类文件描述>
 *
 * @author xc
 **/
public enum ScalingPolicyTypeEnum implements ValidInterface {
    // 最小值 表示缩容
    MIN("min"),
    // 最大值 表示扩容
    MAX("max"),
    ;
    private final String type;

    ScalingPolicyTypeEnum(String type) {
        this.type = type;
    }

    public String getType() {
        return type;
    }


    @Override
    public boolean isValid(String value) {
        ScalingPolicyResourceEnum[] scalingParamResourceEnums = ScalingPolicyResourceEnum.values();
        for (ScalingPolicyResourceEnum scalingParamResourceEnum : scalingParamResourceEnums) {
            if (scalingParamResourceEnum.getResourceName().equals(value)) {
                return true;
            }
        }
        return false;
    }
}
